<?php
$this->title = "Threads";
$this->headTitle($this->title);
?>	

		
		<!-- start content -->
		<div id="threads_inside" class="content">
			<div id="InnerMenu">
				<ul>
					<li>
						<a href="<?php echo $this->url(array('controller'=>'Threads','action'=>'createnew'));?>">
						Create new</a>
					</li>
					<li>
						<a href="<?php echo $this->url(array('controller'=>'Search','action'=>'index'));?>">
						Search threads</a>
					</li>
				</ul> 
			</div>
			<br />
			
			<p>My threads:</p>
			<div id="MyThreads">		
				
				<table title="My Threads" id="hor-minimalist-a" >
				<thead>
				<tr>
					<th>Title</th>
					<th>Date Created</th>
					<th>&nbsp;</th>
					<th>&nbsp;</th>
				</tr>
				</thead>
			<?php foreach($this->myThreads as $thread) : ?>
				<tbody>
				<tr>
					<td>
						<?php echo $this->escape($thread['Title']);?>
					</td>
					<td>
						<?php echo $this->escape( $thread['DateCreated']); ?>
					</td>
					<td>
						<a href="<?php echo $this->url(array('controller'=>'Threads','action'=>'viewthread'))."?id=". $thread["id"] ?>">View Thread</a>
					</td>
					<td>
						<img alt="<?php echo $thread['id']; ?>" src="/med-advisor/application/layouts/scripts/css/Pictures/close.png" id="pic_delete" class="deleteThread">						
					</td>
				</tr>
				</tbody>
			<?php endforeach; ?>
			</table>
				
				
			</div>
		</div>
		<!-- end content -->

		
		<div id="pop_upDeleteThread">
			<form id="form_DeleteThread" name="form_DeleteThread" method="post">
				<p>Are you sure that you want to delete this Thread?</p>
				
				<input type="submit" name="btn_DeleteThread" id="btn_DeleteThread" value="Yes">
				<input type="button" name="btn_DeleteCancelThread" id="btn_DeleteCancelThread" value="No">
				<input type="hidden" id="hdn_ThreadCurrentDelete" name="hdn_ThreadCurrentDelete" value="">
			</form>
		</div>